package com.blb.community_admin.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class ZyCommunity {
  @TableId
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty("小区ID")
  private Long communityId;
  @ExcelProperty("小区名称")
  private String communityName;
  @ExcelProperty("小区编号")
  private String communityCode;
  @ExcelProperty("省级编号")
  private int communityProvenceCode;
  @ExcelProperty("市级编号")
  private int communityCityCode;
  @ExcelProperty("区级编号")
  private int communityTownCode;
  @ExcelIgnore
  private String communityDetailedAddress;
  @ExcelIgnore
  private String communityLongitude;
  @ExcelIgnore
  private String communityLatitude;
  @ExcelIgnore
  private long deptId;
  @ExcelIgnore
  private long communitySort;
  @ExcelIgnore
  private String createBy;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ExcelProperty("创建时间")
  private LocalDateTime createTime;
  @ExcelIgnore
  private String updateBy;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ExcelIgnore
  private LocalDateTime updateTime;
  @ExcelProperty("备注")
  private String remark;


  @TableField(exist = false)
  @ExcelIgnore
  private SysArea province;

    @TableField(exist = false)
    @ExcelIgnore
    private SysArea city;

    @TableField(exist = false)
    @ExcelIgnore
    private SysArea town;

}
